<!--
 * @Description: 
 * @Version: 1.0
 * @Autor: gaoluo
 * @Date: 2021-08-23 19:15:48
 * @LastEditors: gaoluo
 * @LastEditTime: 2021-11-26 15:17:39
 * @FilePath: /nhw/src/components/Card/CardTwig.vue
-->
<template>
  <div
    class="card-twig-container"
    :class="{ str: strong, col: colon, bor: border, adorn: adorn }"
    :style="{ fontSize: size + 'rem' }"
  >
    <Icon :name="icon" size=".4rem" />
    <span class="left"> {{ left }}</span>
    <span :class="{ right: right }" style="width: 70%">{{ right }}</span>
  </div>
</template>

<script>
import { Icon } from "vant";
export default {
  name: "CardTwig",

  components: { Icon },

  directives: {},
  props: {
    left: {
      type: String,
      default: "",
    },
    right: {
      type: [String, Number],
    },
    size: {
      type: [Number, String],
      default: 0.4,
    },
    colon: {
      type: Boolean,
      default: false,
    },
    strong: {
      type: Boolean,
      default: false,
    },
    adorn: {
      type: Boolean,
      default: false,
    },
    icon: {
      type: String,
    },
    border: {
      type: Boolean,
    },
  },
  data() {
    return {};
  },

  mounted() {},

  methods: {},
};
</script>

<style lang="less" scoped>
@import url("~style/mixin.less");
@import url("~@/style/var.less");
.card-twig-container {
  position: relative;
  &.adorn::before {
    content: "";
    display: block;
    width: 5px;
    height: 30px;
    background: linear-gradient(0deg, #e0680f, #e68840);
    border-radius: 3px;
    position: absolute;
  }
  .flex(flex-start);
  padding: 10px 20px;
  box-sizing: border-box;
  text-align: left;
  color: @words;
  .left {
    width: 30%;
    color: @lightWords;
    text-align: left;
    white-space: nowrap;
    text-indent: 0.5em;
    vertical-align: middle;
  }
  .right {
    text-align: right;
  }
  &.col .left::after {
    content: ":";
  }
  &.str {
    font-weight: bolder;
  }
  &.bor::after {
    position: absolute;
    box-sizing: border-box;
    content: " ";
    pointer-events: none;
    top: -50%;
    right: -50%;
    bottom: -50%;
    left: 12%;
    border: 0 dashed #ebedf0;
    -webkit-transform: scale(0.5);
    transform: scale(1.1, 0.5);
    border-bottom-width: 3px;
  }
}
</style>